// $codepro.audit.disable
package edu.gatech.oad.cyberdoc.view.container;

import org.json.JSONException;
import org.json.JSONObject;

import edu.gatech.oad.cyberdoc.view.AdminAccountsPanel;
import edu.gatech.oad.cyberdoc.view.ApplicationPanel;
import edu.gatech.oad.cyberdoc.view.AppointmentGroupsPanel;
import edu.gatech.oad.cyberdoc.view.AppointmentViewPanel;
import edu.gatech.oad.cyberdoc.view.DoctorOrdersStaffPanel;
import edu.gatech.oad.cyberdoc.view.ReportStaffPanel;
import edu.gatech.oad.cyberdoc.view.TreatmentRecordStaffPanel;
import edu.gatech.oad.cyberdoc.view.ViewAppointmentsPanel;
import edu.gatech.oad.cyberdoc.view.ViewUserPanel;
import edu.gatech.oad.cyberdoc.view.invoice.InvoicePanel;
import edu.gatech.oad.cyberdoc.view.menu.DoctorMenu;


public class DoctorPanel extends ContainerPanel {
	
	

	/**
	 * Create the panel.
	 */
	public DoctorPanel() {
		super(new DoctorMenu(), "<html></html>");

		addCard("view_appts", new AppointmentViewPanel());
		addCard("view_users", new ViewUserPanel());
		addCard("view_doctorOrdors", new DoctorOrdersStaffPanel());		
		addCard("view_treatmentRecord",new TreatmentRecordStaffPanel());
		addCard("view_invoices", new InvoicePanel());

		map("view_user", "view_users");
		map("view_invoice", "view_invoices");
	}

	@Override
	public void show(JSONObject response) {
		show("default", null);

		if (response.has("action")) {
			try {
				String action = response.getString("action");

				if (!action.equals("login")) {
					if (action.equals("select_appt")) {
						textLabel.setText("Appointment reserved");
					}
				}
			}
			catch (JSONException e) {
			}
		}
	}
}
